package com.yh.controller;

import com.yh.common.BaseResult;
import com.yh.service.IOrderService;
import lombok.AllArgsConstructor;
import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yh
 */
@RestController
@RequestMapping("/order")
@AllArgsConstructor
public class OrderController {
    private final IOrderService orderService;

    @PostMapping("/buyPro")
    public BaseResult xx(Long proId) throws InterruptedException, RemotingException, MQClientException, MQBrokerException {
        orderService.buyPro(proId);
        return BaseResult.ok();
    }

}
